﻿/********************************************************************************
** @ Date:2025/07/11
** @ Author: Gaojia
** @ Description: 设备管理主界面
** @ Version:1.0.0
** @ Fun:
********************************************************************************/
#ifndef UDeviceMainPage_H
#define UDeviceMainPage_H

#include <QWidget>
#include "UPointTable.h"
#include "ui_UDeviceMainPage.h"

class MyToolButton;
class UDeviceMainPage : public QWidget
{
	Q_OBJECT

public:
	UDeviceMainPage(QWidget *parent = nullptr);
	~UDeviceMainPage();
	void initUi();
	void destroyUi(); //释放资源
	void refushUi();  //刷新界面
	UNodeManager *m_pNodeManager;
private:
	void showPointTable();
	bool eventFilter(QObject* obj, QEvent* event) override;
private:
	Ui::UDeviceMainPageClass ui;
	UPointTable *m_pPointTable;
	QWidget *m_pConfig;
	CBaseNode *m_pCurrNode;    //当前点击的节点
	CBaseNode* m_pParrentNode; //当前点击节点的父节点
	QWidget* m_pCentWidget;
	QMap<QString, MyToolButton*>m_mapToolBtn;
public slots:
	void slot_showCilckedWidget(CBaseNode *pNode, CBaseNode* pchild=nullptr);
	void slot_clicked(CBaseNode *pNode);         //获取在容器单击的设备或者文件夹
	void slot_doubleClicked(CBaseNode *pNode);   //获取在容器双击的设备或者文件夹
	void onCentralWidgetRightClick(const QPoint& pos);
	void slot_deleteNode(CBaseNode* pNode);
};
#endif